package com.getword.web.model;


import org.springframework.util.ResourceUtils;

import java.io.FileNotFoundException;

//@Component
//@PropertySource("classpath:properties/upload-${spring.profiles.active}-Properties.properties")
//@ConfigurationProperties(prefix = "upload")
public class ConstantByProperties {
    public static String basePath;

    static {
        try {
            basePath = ResourceUtils.getURL("classpath:static").getPath()+"/upload/video/"; // /H:/xxx
            basePath = basePath.substring(1);   // 去掉/
        } catch (FileNotFoundException e) {
            e.printStackTrace();
        }
    }

    public static int uploadSpeed = 3;

    public String getBasePath() {
        return basePath;
    }

    public void setBasePath(String basePath) {
        ConstantByProperties.basePath = basePath;
    }

    public static int getUploadSpeed() {
        return uploadSpeed;
    }

    public static void setUploadSpeed(int uploadSpeed) {
        ConstantByProperties.uploadSpeed = uploadSpeed;
    }
}
